home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / programming / other / flexcat / lib / catcomp_h.sd < prev    next >
Text File  |  1999-04-19  |  2KB  |  154 lines

  1. ##stringtype C
  2. ##shortstrings
  3.  
  4. #ifndef %b_STRINGS_H
  5. #define %b_STRINGS_H
  6.  
  7. /****************************************************************
  8.  
  9.    This file was created automatically by `%fv'
  10.    from "%f0"
  11.  
  12.    using CatComp.sd 1.1 (23.05.97)
  13.  
  14.    Do NOT edit by hand!
  15.  
  16. ****************************************************************/
  17.  
  18. #ifndef EXEC_TYPES_H
  19. #include <exec/types.h>
  20. #endif
  21.  
  22. #ifdef  %b_BASIC_CODE
  23. #undef  %b_BASIC
  24. #undef  %b_CODE
  25. #define %b_BASIC
  26. #define %b_CODE
  27. #endif
  28.  
  29. #ifdef  %b_BASIC
  30. #undef  %b_ARRAY
  31. #undef  %b_BLOCK
  32. #define %b_ARRAY
  33. #define %b_BLOCK
  34. #endif
  35.  
  36. #ifdef  %b_ARRAY
  37. #undef  %b_NUMBERS
  38. #undef  %b_STRINGS
  39. #define %b_NUMBERS
  40. #define %b_STRINGS
  41. #endif
  42.  
  43. #ifdef  %b_BLOCK
  44. #undef  %b_STRINGS
  45. #define %b_STRINGS
  46. #endif
  47.  
  48.  
  49. #ifdef %b_CODE
  50. #include <proto/locale.h>
  51. extern struct Library *LocaleBase;
  52. #endif
  53.  
  54. #ifdef %b_NUMBERS
  55.  
  56. #define %i %d
  57.  
  58. #endif /* %b_NUMBERS */
  59.  
  60.  
  61. /****************************************************************************/
  62.  
  63.  
  64. #ifdef %b_STRINGS
  65.  
  66. #define %i_STR %s
  67.  
  68. #endif /* %b_STRINGS */
  69.  
  70.  
  71. /****************************************************************************/
  72.  
  73.  
  74. #ifdef %b_ARRAY
  75.  
  76. struct %b_ArrayType
  77. {
  78.     LONG   cca_ID;
  79.     STRPTR cca_Str;
  80. };
  81.  
  82. static const struct %b_ArrayType %b_Array[] =
  83. {
  84.     { %i, (STRPTR)%i_STR },
  85. };
  86.  
  87.  
  88. #endif /* %b_ARRAY */
  89.  
  90.  
  91. /****************************************************************************/
  92.  
  93.  
  94. #ifdef %b_BLOCK
  95.  
  96. static const char %b_Block[] =
  97. {
  98.  
  99.      "%4a" "%2t"\n    %i_STR "%z"
  100.  
  101. };
  102.  
  103. #endif /* %b_BLOCK */
  104.  
  105.  
  106. /****************************************************************************/
  107.  
  108.  
  109. struct %b_LocaleInfo
  110. {
  111.     APTR li_LocaleBase;
  112.     APTR li_Catalog;
  113. };
  114.  
  115.  
  116.  
  117. #ifdef %b_CODE
  118.  
  119. STRPTR Get%bString(struct %b_LocaleInfo *li, LONG stringNum)
  120. {
  121. LONG   *l;
  122. UWORD  *w;
  123. STRPTR  builtIn;
  124.  
  125.     l = (LONG *)%b_Block;
  126.  
  127.     while (*l != stringNum)
  128.       {
  129.       w = (UWORD *)((ULONG)l + 4);
  130.       l = (LONG *)((ULONG)l + (ULONG)*w + 6);
  131.       }
  132.     builtIn = (STRPTR)((ULONG)l + 6);
  133.  
  134. //#define %b_XLocaleBase LocaleBase
  135. //#define LocaleBase li->li_LocaleBase
  136.     
  137.     if(LocaleBase && li)
  138.         return(GetCatalogStr(li->li_Catalog, stringNum, builtIn));
  139.  
  140. //#undef  LocaleBase
  141. //#define LocaleBase XLocaleBase
  142. //#undef  %b_XLocaleBase
  143.  
  144.     return(builtIn);
  145. }
  146.  
  147. #endif /* %b_CODE */
  148.  
  149.  
  150. /****************************************************************************/
  151.  
  152.  
  153. #endif /* %b_STRINGS_H */
  154.